Brad,
Well it makes me happy to see someone besides me having strange things happening! :-) Hopefully when you get to the bottom of your problem it will fix mine as well.
Regards,
Ray L.
--- In DynoMotion@yahoogroups.com, Brad Murry <bradodarb@...> wrote:
>
> Interesting, if I use CompileAndLoadCoff everything works just fine, it only
> crashes when I use the InvokeAction.
>
>
>
> InvokeAction is what KMotionCNC uses for it's user buttons. If you look at
> the Ccode, it populates the MCodeActions as fires the button commands as if
> they were any other MCode.
>
>
>
>
>
> Still, it does not explain why it works for me and not you using the
> CompileAndLoadCoff.
>
>
>
> Then again, I am not using any PComm in my test prog(print.c). I'll try
> that and get back to you.
>
>
>
> -Brad
>
> From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On
> Behalf Of himykabibble
> Sent: Monday, January 30, 2012 9:21 AM
> To: DynoMotion@yahoogroups.com
> Subject: [DynoMotion] Re: Need Some Ideas....
>
>
>
>
>
> Brad,
>
> No, I do not have the message event hooked up in my app. (Actually, didn't
> even know how to, but now I do! Cool!).
>
> I am running the C programs using CompileAndLoadCoff. Is InvokeAction a
> better way to do it?
>
> I've just run into a new problem as well. Two steps forward, one
> backward.... MDI commands, which WERE working fine, now are not. Non-motion
> commands work fine (G20/21, M3-5, M7-9, etc.), but motion commands never
> issue a Completed callback. The move IS completed, I get the status
> callback, then nothing. When I halt the interpreter, by hitting my E-stop
> button, or re-starting the App, THEN I get the completed callback. So
> something is blocking something there as well. This was working fine until I
> fixed the original PCComm problem.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com <mailto:DynoMotion%40yahoogroups.com> ,
> Brad Murry <bradodarb@> wrote:
> >
> > Hello Ray,
> >
> >
> >
> > I am wondering if there are some .net memory sharing issues going on here.
> >
> >
> >
> > I just set one of my user buttons to fire off the print.c program and I
> get
> > the same result.
> >
> >
> >
> > Do you have the message event wired up? -
> >
> >
> >
> > _Controller.MessageUpdated += new
> > KMConsoleHandler(_Controller_MessageUpdated);
> >
> >
> >
> > I do, and I get the Hello, World message followed by an immediate crash.
> >
> >
> >
> > It is interesting to note that we get the print messages just fine from
> the
> > c# console application.
> >
> >
> >
> >
> >
> > So I tried this code in my button event handler as a quick and dirty
> test::
> >
> >
> >
> > String TheCFile = _Controller.Interpreter.MainPathRoot + @"\C
> > Programs\KMotionCNC\print.c";
> >
> > Console.WriteLine(_Controller.CompileAndLoadCoff(1,
> > TheCFile, false));
> >
> > //Excecute the program we just loaded
> >
> > _Controller.WriteLine("Execute1");
> >
> >
> >
> > And I get my callbacks from the printf just fine!(no crashes).
> >
> >
> >
> > I looks like InvokeAction with printf's are doing something screwy here.
> >
> >
> >
> >
> >
> > Ray- Are you invoking your cprogram via Interpreter.InvokeAction as well?
> >
> >
> >
> > -Brad Murry
> >
> >
> >
> >
> >
> > From: DynoMotion@yahoogroups.com <mailto:DynoMotion%40yahoogroups.com>
> [mailto:DynoMotion@yahoogroups.com <mailto:DynoMotion%40yahoogroups.com> ]
> On
> > Behalf Of himykabibble
> > Sent: Monday, January 30, 2012 1:03 AM
> > To: DynoMotion@yahoogroups.com <mailto:DynoMotion%40yahoogroups.com>
> > Subject: [DynoMotion] Re: Need Some Ideas....
> >
> >
> >
> >
> >
> > Tom,
> >
> > I know this is a stupid question, but is there some interaction or shared
> > resources between the PCComm stuff/Gather buffer and printfs? I had some
> > printfs in the Home code that I had put in while beating on this thing. I
> > just took them out, and it's now working. Nothing else has changed.
> printfs
> > still do not come out in the KMotion console after I re-start my app, so
> > there is something still not completely right, but PCComm is now working,
> so
> > thanks for pointing me in the right direction. I just didn't even really
> > consider the DSP Code, because it's always worked under KMotionCNC....
> >
> > What could cause KMotion to be able to talk to the board just fine, but
> NOT
> > see printfs? For that matter, when in that state, it does not see DSP
> tasks
> > running either, as indficated as there are no green highlights on the task
> > IDs next to the editor window. But after re-starting Kmotion, without
> > restarting my app, all is well.
> >
> > Regards,
> > Ray L.
> >
> > --- In DynoMotion@yahoogroups.com <mailto:DynoMotion%40yahoogroups.com>
> <mailto:DynoMotion%40yahoogroups.com> ,
> > "himykabibble" <jagboy@> wrote:
> > >
> > > Tom,
> > >
> > > The DSP code is my home function, which works perfectly under
> KMotionCNC.
> > But, just to be sure, I went to a three line program:
> > >
> > > main()
> > > {
> > > printf("Doing MsgBox\n");
> > > MsgBox("This is my MessageBox", MB_OK);
> > > printf("MsgBox Done\n");
> > > }
> > >
> > > This gives a different result. The first printf appears every time. The
> > second one never appears. My app does not crash or behave strangely in any
> > way that I can see, even if I open and close it several times. But, if I
> > open KMotion, then open my app, then close it, then re-open it, KMotion
> will
> > still be able to talk to the board, and execute commands from the console,
> > but printfs from the DSP no longer show up in the console window, until I
> > close then re-open KMotion. Does that make any sense?
> > >
> > > I will try to narrow down what in the Home program is influencing the
> > PCComm stuff. But what could that program be doing that it wouldn't be
> doing
> > when run under KMotionCNC, where it's always works perfectly??
> > >
> > > I'll post the code tomorrow.
> > >
> > > Regards,
> > > Ray L.
> > >
> > >
> > > --- In DynoMotion@yahoogroups.com <mailto:DynoMotion%40yahoogroups.com>
> <mailto:DynoMotion%40yahoogroups.com> ,
> > TK <tk@> wrote:
> > > >
> > > > Hi Ray,
> > > >
> > > > Nothing jumps out to me what could be wrong. But it sounds more like a
> > problem in your DSP code. Maybe sends garbage to the PC? What does it do
> > after it sees the persist var cleared? What if you clear it from the
> KMotion
> > Console instead? Otherwise I can look at if you post all the code.
> > >
> > > >
> > > > TK
> > > >
> > > > On Jan 29, 2012, at 10:31 PM, "himykabibble" <jagboy@> wrote:
> > > >
> > > > > Tom/Brad,
> > > > >
> > > > > I'm out of ideas, and hoping one of you has some suggestions on how
> to
> > proceed. As long as I don't touch Persist[100], everything works just
> fine.
> > I can start my app, run programs, exit, connect, disconnect, and it seems
> to
> > work quite reliably. But if I do a MSG on the DSP side, my PCComm code
> > correctly processes it, and clears Persist[100], and shortly after that,
> the
> > board "goes missing", and I get the dialog asking me if I want to run the
> > debugger. Unfortunately, the debugger it wants to run is VS2008, even
> though
> > I'm running VS2010. If I respond "Yes" to the "debug" prompt, it opens
> > VS2008, loads the current source file, and that's it. No debugger, no
> > nothing. That much is, I'm sure, a configuration thing, due to having both
> > versions installed, but I not only don't know how to fix it, I am
> reluctant
> > to try to get 2008 working in that context, for fear it will screw up
> 2010,
> > which is what I generally use. I only installed 2008 to be able to build
> > KMotion, and otherwise don't use it.
> > > > >
> > > > > Anyway, I am convinced it is clearing Persist[100], while not the
> > actual cause of the problem, is somehow triggering whatever it is that is
> > going wrong, but I'm totally at a loss to understand what is going wrong,
> or
> > how, and have had no success in trying to narrow it down. If I comment out
> > the one line that clears Persist[100] after a PCComm command, the problem
> > goes away entirely, and everything works perfectly. If I change that one
> > line to write *any* other location, like 99, or 101, the failure
> "signature"
> > changes - rather than crashing almost immediately after the Persist
> location
> > is written, the app continues to run normally until I close it.
> > > > >
> > > > > But, if I then re-start the app without first disconnecting and
> > reconnecting the board, I get the debug dialog again as soon as the new
> app
> > instance recognizes the connection is available, and does its
> KM_Controller
> > initialization. I've stepped through all the init code and the
> constructors
> > on that second start-up, and whatever is going wrong is going wrong AFTER
> > they have all run, and I don't know how to stop it at a point that would
> > give me any useful information about what is going wrong.
> > > > >
> > > > > Not surprisingly, if I change the location used for PComm (I shifted
> > it from Var 100 to 80), the problem follows it to the new location. So
> it's
> > not the specific location that's at issue, it has to be something
> connected
> > with that functionality. But we know the DSP side works fine, and the PC
> > side isn't actually *doing* anything, other than writing that one word. So
> > what the heck is really happening?
> > > > >
> > > > > I've double-checked and all my KM_Controller accesses are surrounded
> > with locks, and I'm not doing anything that requires grabbing the token
> (the
> > functions for doing Gather operations do use the token, but those are
> > commented out now).
> > > > >
> > > > > At the point where it's crashing, there are three threads running:
> > > > > 1) The main app thread
> > > > > 2) A thread running the WCF server for the toolpath display (which
> is
> > basically idle, since the toolpath window is not open)
> > > > > 3) A BackgroundWorker thread doing most of the GUI updates
> > > > >
> > > > > The app thread also has one Timer running, at a 100mSec rate, mostly
> > for periodically testing the connection, and updating the "connected" LED
> in
> > the GUI, and showing me the GUI state through a set of on-screen
> checkboxes.
> > This thread is the one that calls the PCComm handler. All Timer methods
> are
> > very simple and lightweight.
> > > > >
> > > > > Any ideas how to proceed? I'd be happy to post my code if that would
> > help. I'm truly stuck on this one.
> > > > >
> > > > > Regards,
> > > > > Ray L.
> > > > >
> > > > >
> > > >
> > >
> >
>
|
|